package com.cskaoyan.controller;

import com.cskaoyan.bean.AdminListRespVo;
import com.cskaoyan.bean.Log;
import com.cskaoyan.bean.LogListBean;
import com.cskaoyan.bean.params.BaseParam;
import com.cskaoyan.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * @USER: cuiweiguo#
 * @DATE: 2022/5/6
 * @TIME: 18:54
 * @PROJECT_NAME: mallproject2
 */
@RestController
@RequestMapping("admin/log")
public class LogController {
    @Autowired
    LogService logService;

    //GET http://182.92.235.201:8083/admin/log/list?page=1&limit=20&sort=add_time&order=desc
    @RequestMapping("list")
    public AdminListRespVo<Log> list(String name, BaseParam baseParam, HttpSession session) {
        String id = session.getId();
        LogListBean logListBean = logService.queryLogList(baseParam, name);
        return AdminListRespVo.listOk(logListBean);
        //return null;
    }


}
